<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>登录</title>

		<meta name="description" content="login" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="static/bootstrap/bootstrap.min.css" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="static/ace/css/ace.min.css" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="static/ace/css/ace-part2.min.css" />
		<![endif]-->
		<link rel="stylesheet" href="static/ace/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="static/ace/css/ace-ie.min.css" />
		<![endif]-->

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="static/bootstrap/html5shiv.min.js"></script>
		<script src="static/bootstrap/respond.min.js"></script>
		<![endif]-->
		<script src="static/jquery/jquery-2.1.1.min.js"></script>
	</head>

	<body class="login-layout blur-login">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container" style="padding-top: 60px;">
							<div class="center">
								<h1>
									<span class="red" id="id-text2">固管家服务平台</span>
								</h1>
								<h4 class="blue" id="id-company-text">&copy; 东标</h4>
							</div>

							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger" id="msg">
												<i class="ace-icon fa fa-coffee green"></i>
												固管家-危废处置好帮手
											</h4>

											<div class="space-6"></div>

											<form id="login-form">
												<fieldset>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control" name="username" placeholder="用户名" autocomplete="off"
															datatype="*"  nullmsg="请输入用户名！" data-error="用户名或密码错误" v-model="params.username"/>
															<i class="ace-icon fa fa-user"></i>
														</span>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control" name="password" placeholder="密码" autocomplete="off"
															datatype="*"  nullmsg="请输入密码！" v-model="params.password"/>
															<i class="ace-icon fa fa-lock"></i>
														</span>
													</label>
													
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control width-55 pull-left" name="code" placeholder="验证码" autocomplete="off"
															datatype="*"  nullmsg="请输入验证码！" data-error="验证码错误" v-model="params.code"/>
															<img :src="code" id="code"
																 class="pull-right" title="点击换一张" style="cursor: pointer;border: 1px solid rgb(181, 181, 181);" @click="changeCode"/>
														</span>
													</label>

													<div class="space"></div>

													<div class="clearfix" >
														<span type="button" class="width-100 pull-right btn btn-primary" id="login-btn" @click="login">
															<i class="ace-icon fa fa-key"></i>
															<span class="bigger-115" >登&nbsp;录</span>
														</span>
													</div>

													<div class="space-4"></div>
												</fieldset>
											</form>
										</div><!-- /.widget-main -->

										<div class="toolbar clearfix">
											<div style="width: 100%;text-align: center;">
												<a href="javascript:void(0);" class="forgot-password-link bigger-130" style="text-decoration: none;">
													<i class="ace-icon fa fa-arrow-left"></i>
													请关注微信公众号"固管家"进行注册!
													<i class="ace-icon fa fa-arrow-right"></i>
												</a>
											</div>
										</div>
									</div><!-- /.widget-body -->
								</div><!-- /.login-box -->
							</div><!-- /.position-relative -->

						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div><!-- /.main-content -->
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<!-- <![endif]-->

		<!--[if IE]>
		<![endif]-->

		<!--[if !IE]> -->
		<!--<script type="text/javascript">-->
			<!--window.jQuery || document.write("<script src='../../static/jquery/jquery.min.js'>"+"<"+"/script>");-->
		<!--</script>-->
		<!--&lt;!&ndash; <![endif]&ndash;&gt;-->

		<!--&lt;!&ndash;[if IE]>-->
		<!--<script type="text/javascript">-->
		 <!--window.jQuery || document.write("<script src='../../static/jquery/jquery1x.min.js'>"+"<"+"/script>");-->
		<!--</script>-->
		<!--<![endif]&ndash;&gt;-->
		<!---->
		<!--<script type="text/javascript">-->
			<!--if('ontouchstart' in document.documentElement) document.write("<script src='../../static/jquery/jquery.mobile.custom.min.js'>"+"<"+"/script>");-->
		<!--</script>-->

		<script type="text/javascript" src="static/layer/layer.js"></script>
		<script type="text/javascript" src="static/validate/Validform_v5.3.2_min.js"></script>
		<script type="text/javascript" src="static/vue/vuejs-2.5.16.js"></script>
		<script type="text/javascript" src="static/vue/axios-0.18.0.js"></script>
		<script>
			let v = new Vue({
				el:'.main-container',
				data:{
					code:'code.jpg',
					params:{}
				},
				methods:{
					changeCode:function () {
						this.code = 'code.jpg?' + new Date().toLocaleTimeString()
					},
					login:function () {
						axios({
							url:'login',
							method:'post',
							data:this.params
						}).then(resp => {
							if(resp.data.success){
								sessionStorage.setItem("loginUser",JSON.stringify(resp.data.obj.loginUser));
								sessionStorage.setItem("resources",JSON.stringify(resp.data.obj.resources));
								location.href = "toIndex";
							}else{
								layer.msg(resp.data.msg);
							}
						}).catch(error => {
							layer.msg(error.message);
						})
					}
				}
			})
		</script>
	</body>
</html>
